package io.sage.modules.outwarehouse.service.impl;

import java.util.Date;
import java.util.List;
import java.util.Map;

import io.sage.modules.outwarehouse.entity.BGoodsReceiveRecordExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import io.sage.modules.outwarehouse.dao.BGoodsReceiveRecordMapper;
import io.sage.modules.outwarehouse.entity.BGoodsReceiveRecord;
import io.sage.modules.outwarehouse.service.BGoodsReceiveRecordService;

@Service("goodsReceiveRecordService")
public class BGoodsReceiveRecordServiceImpl implements BGoodsReceiveRecordService{
	
	@Autowired
	private BGoodsReceiveRecordMapper goodsReceiveRecordMapper;
	
	@Override
	public List<BGoodsReceiveRecord> selectReceiveRecordList(Map<String, Object> params) {
		return goodsReceiveRecordMapper.selectReceiveRecordList(params);
	}

	@Override
	public int deleteBatchIds(Integer[] ids) {
		return goodsReceiveRecordMapper.deleteBatchIds(ids);
	}

	@Override
	public BGoodsReceiveRecord selectByPrimaryKey(Integer id) {
		return goodsReceiveRecordMapper.selectByPrimaryKey(id);
	}

	@Override
	public int insert(BGoodsReceiveRecord goodsReceiveRecord) {
		goodsReceiveRecord.setCreateTime(new Date());
		goodsReceiveRecord.setUpdateTime(new Date());
		return goodsReceiveRecordMapper.insertSelective(goodsReceiveRecord);
	}

	@Override
	public int updateByPrimaryKeySelective(BGoodsReceiveRecord goodsReceiveRecord) {
		goodsReceiveRecord.setUpdateTime(new Date());
		return goodsReceiveRecordMapper.updateByPrimaryKeySelective(goodsReceiveRecord);
	}

	@Override
	public int updateStatus(Map<String, Object> param) {
		return goodsReceiveRecordMapper.updateStatus(param);

	}
}
